package com.example.week1.adapter;

import android.widget.ImageView;

import androidx.annotation.Nullable;

import com.bumptech.glide.Glide;
import com.bumptech.glide.load.resource.bitmap.CircleCrop;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.example.week1.R;
import com.example.week1.entity.XiaEntity;

import java.util.List;

public class MyAdapter extends BaseQuickAdapter<XiaEntity.DataBean, BaseViewHolder> {

    public MyAdapter(int layoutResId, @Nullable List<XiaEntity.DataBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, XiaEntity.DataBean item) {
        helper.setText(R.id.tv,item.getTitle());
        Glide.with(mContext).load(item.getPic()).transform(new CircleCrop()).into((ImageView) helper.getView(R.id.iv));
    }
}
